import type {
  AxiosRequestConfig,
  InternalAxiosRequestConfig,
  AxiosResponse
} from 'axios';
// InternalAxiosRequestConfig 继承 AxiosRequestConfig，并且添加了一个heards:AxiosRequestHeaders属性

export interface IRequestInterceptors<T = AxiosResponse> {
  // requestInterceptors?: (
  //   config: InternalAxiosRequestConfig
  // ) => InternalAxiosRequestConfig;
  requestInterceptors?: (config: any) => any;
  requestInterceptorsCatch?: (err: any) => any;
  responseInterceptors?: (res: T) => T;
  responseInterceptorsCatch?: (err: any) => any;
}

export interface Iconfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: IRequestInterceptors<T>;
  showLoading?: boolean;
}
